package com.study.d1_object;

import java.util.Objects;

public class Test {
    public static void main(String[] args) {
        Student student = new Student("小白",20);
        Student student2 = new Student("小白",20);
        String string = student.toString();
        System.out.println(string);
        //比较两个对象地址用“==”
        //Object提供equals目的让子类重写，以便程序员制定自己比较的规则
        System.out.println(student.equals(student2));
        System.out.println(Objects.isNull(student));
    }
}
